package ar.com.solidussource.howmuchmobile.activities.utils;

import android.app.Activity;
import android.app.ProgressDialog;

/**
 * Created with IntelliJ IDEA.
 * User: FT31270775
 * Date: 06/11/12
 * Time: 17:20
 * To change this template use File | Settings | File Templates.
 */
public class ThreadProgress extends Activity implements Runnable {
    private static ProgressDialog progressDialog;

    @Override
    public void run() {


    }

    public void showProgressDialog() {
//		progressDialog = ProgressDialog.show(this, "", "Cargando...");
//		progressDialog = ProgressDialog.show(this, "", "Cargando...", true, true, this);
        progressDialog = new ProgressDialog(this);
        progressDialog.setCancelable(true);
        //progressDialog.setOnCancelListener(this);
        progressDialog.setCanceledOnTouchOutside(false);
        progressDialog.setIndeterminate(true);
        progressDialog.setMessage("Cargando...");
        progressDialog.show();


        getIntent().putExtra("ProgressDialogIsShowing", true);
    }

    public void hideProgressDialog() {
        if (progressDialog != null) {
            progressDialog.dismiss();
            progressDialog = null;
        }

        getIntent().putExtra("ProgressDialogIsShowing", false);
    }
}
